package com.oig.sys.base.dto;


import com.oig.common.validator.GroupAdd;
import com.oig.common.validator.GroupEdit;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@Schema
@Data
public class EnumItemDto {

    @Schema(description = "主键id")
    private Integer id;

    @Schema(description = "枚举值")
    @NotEmpty(message = "枚举值编码不能为空", groups={GroupAdd.class, GroupEdit.class})
    @Length(max = 16,min = 1, message = "枚举值编码1~16位", groups={GroupAdd.class, GroupEdit.class})
    private String itemCode;

    @Schema(description = "枚举名称")
    @NotEmpty(message = "枚举名称不能为空", groups={GroupAdd.class, GroupEdit.class})
    private String itemName;

    @Schema(description = "枚举说明")
    private String itemDesc;
    /**
     * 1-是，0-否（作为备选项时不展示，不可选）
     */
    @Schema(description = "是否展示 1-是，0-否")
    @Pattern(regexp = "[0|1]", message = "是否展示只能为0或1")
    private String showFlag;

    @Schema(description = "是否可修改 0-否 1-是 默认1，目前控制初始化进去的枚举项不能删除")
    @Pattern(regexp = "[0|1]", message = "是否展示只能为0或1 默认是1")
    private String modifyFlag;

    @Schema(description = "枚举类型编码")
    private Integer dictId;


    @Schema(description = "配了父枚举，这里填父枚举的枚举项，如果枚举没有配置父枚举，也可以手填")
    private String groupCode;
}
